There is known a technique for generating an arranged image file that represents an arranged image. In the arranged image, a first image and a second image are arranged. For example, a document of a size that is too large to be read at once is read by a scanner in two stages, and scan data of a first image and scan data of a second image are acquired as a result. An image file is generated so that the image file represents, as an entire sheet of an original, an arranged image in which the first and second images are arranged by using the two sets of scan data. The positions of the first and second images arranged in the arranged image are determined by extracting, for each of the two images, characteristics of a region along one side of the respective image, and comparing the extracted characteristics of the two images.